package com.tms.utils;

import com.github.pagehelper.PageInfo;
import com.tms.domain.*;
import com.tms.domain.req.BillReq;
import com.tms.domain.req.ScrapReq;

import java.util.List;


/**
 * @author ozj
 */
public class Data {

    /**
     * 用户no
     */
    String no;

    /**
     * 用户token
     */
    String token;

    /**
     * 存放对象User
     */
    User user;

    /**
     * 存放对象workcell
     */
    Workcell workcell;

    /**
     * 存放对象workcells
     */
    List<Workcell> workcells;

    /**
     * 存放对象billReqs
     */
    List<BillReq> billReqs;

    /**
     * 存放对象users
     */
    PageInfo<User> users;

    /**
     * 存放对象users
     */
    PageInfo<UseRecord> useRecords;

    /**
     * 存放对象repairApps
     */
    PageInfo<RepairApp> repairApps;

    /**
     * 存放对象bills
     */
    PageInfo<BillResponse> bills;

    /**
     * 存放对象scraps
     */
    PageInfo<Scrap> scraps;

    /**
     * 存放对象tools
     */
    PageInfo<Tool> tools;

    /**
     * 存放对象lifeCycles
     */
    PageInfo<LifeCycle> lifeCyclePaging;

    /**
     * 存放对象tDefs
     */
    PageInfo<TDef> tDefs;

    /**
     * 存放对象useRecord
     */
    UseRecord useRecord;

    /**
     * 存放对象repairApp
     */
    RepairApp repairApp;

    /**
     * 存放对象bill
     */
    BillResponse bill;

    /**
     * 存放对象scrap
     */
    Scrap scrap;

    /**
     * 存放对象type
     */
    private List<Type> types;

    /**
     * 存放对象tDef
     */
    private TDef tDef;

    /**
     * 存放对象tool
     */
    private Tool tool;

    /**
     * 存放对象type
     */
    private Type toolType;

    /**
     * 存放对象lifeCycles
     */
    private List<LifeCycle> lifeCycles;

    /**
     * 存放对象Familys
     */
    private List<Family> families;

    /**
     * 存放对象billReq
     */
    private BillReq billReq;

    private ScrapReq scrapReq;

    private int id;

    private String type;

    private List<Location> locations;

    private List<ProductLine> productLines;

    //故障概率
    private double probability;

    public Data(Type type) {
        this.toolType = type;
    }

    public Data(String type, int id, List<Location> locations, List<ProductLine> productLines) {
        this.type = type;
        this.id = id;
        this.locations = locations;
        this.productLines = productLines;
    }

    public Data(String type, List list) {
        if (type.equals("types")) {
            this.types = list;
        } else if (type.equals("workcells")) {
            this.workcells = list;
        } else if (type.equals("lifeCycles")) {
            this.lifeCycles = list;
        } else if (type.equalsIgnoreCase("families")) {
            families = list;
        }
    }

    public Data(String token) {
        this.token = token;
    }

    public Data(String no, String token) {
        this.no = no;
        this.token = token;
    }

    public Data(String token, User user) {
        this.token = token;
        this.user = user;
    }

    public Data(String no, String token, User user) {
        this.no = no;
        this.token = token;
        this.user = user;
    }

    public Data(String type, PageInfo info) {
        switch (type) {
            case "users":
                this.users = info;
                break;
            case "useRecords":
                this.useRecords = info;
                break;
            case "repairApps":
                this.repairApps = info;
                break;
            case "bills":
                this.bills = info;
                break;
            case "scraps":
                this.scraps = info;
                break;
            case "tools":
                this.tools = info;
                break;
            case "lifeCycles":
                this.lifeCyclePaging = info;
                break;
            case "tDefs":
                this.tDefs = info;
                break;
            default:
                break;
        }
    }

    public Data(List list, String type) {
        switch (type) {
            case "billReqs":
                this.billReqs = list;
                break;
            case "workcells":
                this.workcells = list;
                break;
            default:
                break;
        }
    }

    public Data(List<Workcell> workcells) {
        this.workcells = workcells;
    }

    public Data(UseRecord useRecord) {
        this.useRecord = useRecord;
    }

    public Data(RepairApp repairApp) {
        this.repairApp = repairApp;
    }

    public Data(User user) {
        this.user = user;
    }

    public Data(Workcell workcell) {
        this.workcell = workcell;
    }

    public Data(BillResponse bill) {
        this.bill = bill;
    }

    public Data(Scrap scrap) {
        this.scrap = scrap;
    }

    public Data(TDef tDef) {
        this.tDef = tDef;
    }

    public Data(Tool tool) {
        this.tool = tool;
    }

    public Data(BillReq billReq) {
        this.billReq = billReq;
    }

    public Data(ScrapReq scrapReq) {
        this.scrapReq = scrapReq;
    }

    public Data(int id) {
        this.id = id;
    }

    public Data(double probability) {
        this.probability = probability;
    }

    public PageInfo<TDef> gettDefs() {
        return tDefs;
    }

    public void settDefs(PageInfo<TDef> tDefs) {
        this.tDefs = tDefs;
    }

    public PageInfo<LifeCycle> getLifeCyclePaging() {
        return lifeCyclePaging;
    }

    public void setLifeCyclePaging(PageInfo<LifeCycle> lifeCyclePaging) {
        this.lifeCyclePaging = lifeCyclePaging;
    }

    public List<LifeCycle> getLifeCycles() {
        return lifeCycles;
    }

    public void setLifeCycles(List<LifeCycle> lifeCycles) {
        this.lifeCycles = lifeCycles;
    }

    public Tool getTool() {
        return tool;
    }

    public double getProbability() {
        return probability;
    }

    public void setProbability(double probability) {
        this.probability = probability;
    }

    public void setTool(Tool tool) {
        this.tool = tool;
    }

    public TDef gettDef() {
        return tDef;
    }

    public void settDef(TDef tDef) {
        this.tDef = tDef;
    }

    public PageInfo<Tool> getTools() {
        return tools;
    }

    public BillReq getBillReq() {
        return billReq;
    }

    public void setBillReq(BillReq billReq) {
        this.billReq = billReq;
    }

    public void setTools(PageInfo<Tool> tools) {
        this.tools = tools;
    }

    public List<Type> getTypes() {
        return types;
    }

    public void setTypes(List<Type> types) {
        this.types = types;
    }

    public Scrap getScrap() {
        return scrap;
    }

    public void setScrap(Scrap scrap) {
        this.scrap = scrap;
    }

    public PageInfo<Scrap> getScraps() {
        return scraps;
    }

    public void setScraps(PageInfo<Scrap> scraps) {
        this.scraps = scraps;
    }

    public BillResponse getBill() {
        return bill;
    }

    public void setBill(BillResponse bill) {
        this.bill = bill;
    }

    public PageInfo<BillResponse> getBills() {
        return bills;
    }

    public void setBills(PageInfo<BillResponse> bills) {
        this.bills = bills;
    }

    public PageInfo<RepairApp> getRepairApps() {
        return repairApps;
    }

    public void setRepairApps(PageInfo<RepairApp> repairApps) {
        this.repairApps = repairApps;
    }

    public PageInfo<UseRecord> getUseRecords() {
        return useRecords;
    }

    public void setUseRecords(PageInfo<UseRecord> useRecords) {
        this.useRecords = useRecords;
    }

    public PageInfo<User> getUsers() {
        return users;
    }

    public void setUsers(PageInfo<User> users) {
        this.users = users;
    }

    public RepairApp getRepairApp() {
        return repairApp;
    }

    public void setRepairApp(RepairApp repairApp) {
        this.repairApp = repairApp;
    }

    public List<Workcell> getWorkcells() {
        return workcells;
    }

    public void setWorkcells(List<Workcell> workcells) {
        this.workcells = workcells;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Workcell getWorkcell() {
        return workcell;
    }

    public void setWorkcell(Workcell workcell) {
        this.workcell = workcell;
    }

    public UseRecord getUseRecord() {
        return useRecord;
    }

    public void setUseRecord(UseRecord useRecord) {
        this.useRecord = useRecord;
    }

    public ScrapReq getScrapReq() {
        return scrapReq;
    }

    public void setScrapReq(ScrapReq scrapReq) {
        this.scrapReq = scrapReq;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public List<Location> getLocations() {
        return locations;
    }

    public void setLocations(List<Location> locations) {
        this.locations = locations;
    }

    public List<ProductLine> getProductLines() {
        return productLines;
    }

    public void setProductLines(List<ProductLine> productLines) {
        this.productLines = productLines;
    }

    public Type getToolType() {
        return toolType;
    }

    public void setToolType(Type toolType) {
        this.toolType = toolType;
    }

    public List<BillReq> getBillReqs() {
        return billReqs;
    }

    public void setBillReqs(List<BillReq> billReqs) {
        this.billReqs = billReqs;
    }

    public List<Family> getFamilies() {
        return families;
    }

    public void setFamilies(List<Family> families) {
        this.families = families;
    }
}
